#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QToolBar>
#include <QTabWidget>
#include <QDebug>

#include <ColorWheel>
#include <HueSlider>
#include <color_2d_slider.hpp>
#include <color_line_edit.hpp>
#include <advanced_color_selector.hpp>

#include "demo_window.h"

using namespace color_widgets;

MainWindow::MainWindow() :
    QMainWindow(),
    color("#f48")
{
    resize(512, 512);

    auto mainLayout = new QVBoxLayout();

    auto *widget = new QWidget();
    widget->setLayout(mainLayout);
    setCentralWidget(widget);

    advanced = new AdvancedColorSelector();
    advanced->setEnabledWidgets(AdvancedColorSelector::RGBSliders);
    mainLayout->addWidget(advanced);

    auto toolbar = new QToolBar();
    toolbar->addAction(
        "red",
        [this]() {
            advanced->setColor({"#f00"});
        }
    );
    toolbar->addAction(
        "save",
        [this]() {
            advanced->saveToHistory();
        }
    );
    addToolBar(toolbar);
}

MainWindow::~MainWindow() {
}
